<include file="__THEME__/header" />
<link href="../Public/account.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script type="text/javascript" src="../Public/js/avatar/avatar.js"></script>
<script type="text/javascript" src="../Public/js/account.js"></script>
<script>
    function checkon(o){
        if( o.checked == true ){
            $(o).parents('li').addClass('Set') ;
        }else{
            $(o).parents('li').removeClass('Set') ;
        }
    }
    
    function getChecked() {
        var ids = new Array();
        $.each($('li input:checked'), function(i, n){
            ids.push( $(n).val() );
        });
        return ids;
    }
    
    function checkSubmit() {
    	$('#show_ids').val( getChecked().toString() );
    	return true;
    }
    
<eq name="type" value="my">
	var delay    = 0;
	var shown_id = 0;
	
	$(document).ready(function(){
	    $("div[rel='medal']").hover(
	        function(){
	            var medal_id = $(this).attr('medal_id');
	            
	            clearTimeout(delay);
	            delay = setTimeout(function(){
	                medal_show(medal_id);
	            }, 200);
	        },
	        function(){
	            clearTimeout(delay);
	            delay = setTimeout(function(){
	                medal_hide();
	            }, 200);
	        }
	    );
	    
	    $("table[rel='medal']").hover(
	        function(){
	            clearTimeout(delay);
	        },
	        function(){
	            delay = setTimeout(function(){
	                medal_hide();
	            }, 200);
	        }
	    );
	});
	
	function medal_show(medal_id) {
	    if (medal_id != shown_id) {
	        medal_hide();
	        shown_id = medal_id;
	        $("#popbox_"+medal_id).fadeIn();
	    }
	}
	
	function medal_hide() {
	    shown_id = 0;
	    $("table[rel='medal']:visible").fadeOut();
	}
</eq>
    
</script>
<div class="content"><!-- 内容 begin  --> 
  <include file="__THEME__/apps" />
  <div class="main"> <!-- 右侧内容 begin  -->
    <div class="mainbox">
      <div class="mainbox_C no_r"> 
        <!-- page_title end -->
        <div class="tab-menu"><!-- 切换标签 begin  -->
          <ul>
            <volist id="vo" name="accountmenu">
              <li><a href="{:U('home/Account/'.$vo['url'])}" 
                <php>if(ACTION_NAME==$vo['url']){</php>
                class="on"
                <php>}</php>
                ><span>{$vo.name}</span></a></li>
            </volist>
          </ul>
        </div>
        <!-- 切换标签 end  -->
        <div class="MenuSub"> <a href="{:U('home/Account/medal',array('type'=>'my'))}" 
          <eq name="type" value="my">class="on"</eq>
          >我的勋章</a> | <a href="{:U('home/Account/medal',array('type'=>'manage'))}" 
          <eq name="type" value="manage">class="on"</eq>
          >勋章设置</a> </div>
<eq name="type" value="my"> 
          <!-- 我的勋章 -->
          <div class="mainbox_C_C">
            <ul class="icon_applist">
              <volist name="user_medal" id="vo">
                <php>if($vo['received_time'] != 0) {</php>
                <li class="ok">
                  <div rel="medal" medal_id="{$vo.medal_id}">
                    <div class="c1"><img src="{$vo.big_icon_url}" border="0" /></div>
                    <div class="c2">
                      <h3>{$vo.title}</h3>
                    </div>
                  </div>
                  <php>}else {</php>
                <li>
                  <div class="c1">
                    <div rel="medal" medal_id="{$vo.medal_id}"><img src="{$vo.big_icon_url}"/></div>
                    <div class="c2">
                      <h3>{$vo.title}</h3>
                    </div>
                  </div>
                  <php>}</php>
                  
                  <!-- 鼠标经过时的弹窗框 -->
                  <div style="position:relative; width:100%; height:1px;" >
                    <table id="popbox_{$vo.medal_id}" rel="medal" medal_id="{$vo.medal_id}" cellspacing="0" cellpadding="0" border="0" class="boxy-wrapper" style="left:-115px;top:5px;z-index:99999;display:none;text-align: left;" >
                      <tbody>
                        <tr>
                          <td class="boxy-top-left"></td>
                          <td class="boxy-top"></td>
                          <td class="boxy-top-right"></td>
                        </tr>
                        <tr>
                          <td class="boxy-left"><img src="__THEME__/images/zw_img.gif" width="6px" /></td>
                          <td class="boxy-inner"><div style="position:relative; height:0; width:100%;">
                              <div class="q_ico_arrow3" style="left:49%;"></div>
                            </div>
                            <div style="padding:15px; width:300px;">
                              <div class="left" style="width:70px;"><img src="{$vo['big_icon_url']}"/></div>
                              <div class="left" style="width:229px;">
                                <h3 class="lh25 f14px"><strong>{$vo['title']}</strong></h3>
                                <p>{$vo['description']}</p>
                              </div>
                              <div class="c"></div>
                            </div>
                            <div style="padding:5px 15px; background-color:#F7F7F7; border-top:1px dashed #9F9F9F; clear:both;">
                              <div class="honortip">
                                <php>if($vo['received_time'] != '0') {</php>
	                                <div class="risucc">于 <span>{$vo['received_time']}</span> 获得</div>
	                                <php>if($vo['next_level_time'] != '0') {</php>
	                                   <div class="upd"><span class="ico_upd"></span>升级：还需要 <span>{$vo['next_level_time']}</span></div>
	                                <php>}</php>
                                <php>}else {</php>
                                    <div class="">{$vo['alert_message']}</div>
                                <php>}</php>
                              </div>
                              <div class="operat">
		                       <span class="right"><a href="{:U('home/Account/medal',array('type'=>'my'))}" class="btn_w">查看勋章</a></span>
		                       <span class="ico_app_manage"></span>
		                       <a href="{:U('home/Account/medal',array('type'=>'manage'))}">显示设置</a>
		                    </div>
                            </div></td>
                          <td class="boxy-right"><img src="__THEME__/images/zw_img.gif" width="6px" /></td>
                        </tr>
                        <tr>
                          <td class="boxy-bottom-left"></td>
                          <td class="boxy-bottom"></td>
                          <td class="boxy-bottom-right"></td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <!-- 鼠标经过时的弹窗框 END -->
                  
                </li>
              </volist>
            </ul>
          </div>
          <else/>
          <!-- 勋章管理 -->
          <div class="mainbox_C_C"> 
<php>if(empty($user_medal)){</php>
            暂无勋章
<php>}else {</php>
            <form method="post" action="{:U('home/Account/doMedalManage')}" onsubmit="return checkSubmit();">
              <input type="hidden" name="show_ids" id="show_ids" value="">
              <input type="hidden" name="medal_manage" value="1">
              <ul class="icon_applist">
                <volist name="user_medal" id="vo">
                  <php>if($vo['is_active']=='1') {</php>
                  <li class="Set">
                    <div class="c1"><img src="{$vo.big_icon_url}" /></div>
                    <div class="c2">
                      <h3>{$vo.title}</h3>
                    </div>
                    <div class="c3">
                      <input type="checkbox" checked="" onclick="checkon(this);" value="{$vo.medal_id}">
                      在首页显示</div>
                  </li>
                  <php>}else {</php>
                  <li class="">
                    <div class="c1"><img src="{$vo.big_icon_url}" /></div>
                    <div class="c2">
                      <h3>{$vo.title}</h3>
                    </div>
                    <div class="c3">
                      <input type="checkbox" onclick="checkon(this);" value="{$vo.medal_id}">
                      在首页显示</div>
                  </li>
                  <php>}</php>
                </volist>
              </ul>
              <div class="alC lineD_top pt10" style="float:left; width:100%"><input type="submit" value="保存" class="btn_b"></div>
            </form>
          </div>
<php>}</php>
        </eq>
      </div>
    </div>
  </div>
  <!-- 右侧内容 end  -->
  <div class="c"></div>
</div>
<!-- 内容 end --> 
<include file="__THEME__/footer" />